﻿using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using LiveCharts.Definitions.Points;
using LiveCharts.Definitions.Series;
using LiveCharts.Dtos;
using LiveCharts.SeriesAlgorithms;
using LiveCharts.Wpf;

namespace LiveCharts.Wpf
{
	// Token: 0x02000025 RID: 37
	public class GRowSeries : GearedSeries, ISeriesView, IRowSeriesView
	{
		// Token: 0x06000175 RID: 373 RVA: 0x00002E42 File Offset: 0x00001042
		public GRowSeries()
		{
			base.Model = new RowAlgorithm(this);
			this.method_2();
		}

		// Token: 0x06000176 RID: 374 RVA: 0x00002E5C File Offset: 0x0000105C
		public GRowSeries(object configuration)
		{
			base.Model = new RowAlgorithm(this);
			base.Configuration = configuration;
			this.method_2();
		}

		// Token: 0x1700003E RID: 62
		// (get) Token: 0x06000177 RID: 375 RVA: 0x00002E7D File Offset: 0x0000107D
		// (set) Token: 0x06000178 RID: 376 RVA: 0x00002E8F File Offset: 0x0000108F
		public double MaxRowHeigth
		{
			get
			{
				return (double)base.GetValue(GRowSeries.MaxRowHeigthProperty);
			}
			set
			{
				base.SetValue(GRowSeries.MaxRowHeigthProperty, value);
			}
		}

		// Token: 0x1700003F RID: 63
		// (get) Token: 0x06000179 RID: 377 RVA: 0x00002EA2 File Offset: 0x000010A2
		// (set) Token: 0x0600017A RID: 378 RVA: 0x00002EB4 File Offset: 0x000010B4
		public double RowPadding
		{
			get
			{
				return (double)base.GetValue(GRowSeries.RowPaddingProperty);
			}
			set
			{
				base.SetValue(GRowSeries.RowPaddingProperty, value);
			}
		}

		// Token: 0x17000040 RID: 64
		// (get) Token: 0x0600017B RID: 379 RVA: 0x00002EC7 File Offset: 0x000010C7
		// (set) Token: 0x0600017C RID: 380 RVA: 0x00002ED9 File Offset: 0x000010D9
		public BarLabelPosition LabelsPosition
		{
			get
			{
				return (BarLabelPosition)base.GetValue(GRowSeries.LabelPositionProperty);
			}
			set
			{
				base.SetValue(GRowSeries.LabelPositionProperty, value);
			}
		}

		// Token: 0x17000041 RID: 65
		// (get) Token: 0x0600017D RID: 381 RVA: 0x00002EEC File Offset: 0x000010EC
		// (set) Token: 0x0600017E RID: 382 RVA: 0x00002EFE File Offset: 0x000010FE
		public bool SharesPosition
		{
			get
			{
				return (bool)base.GetValue(GRowSeries.SharesPositionProperty);
			}
			set
			{
				base.SetValue(GRowSeries.SharesPositionProperty, value);
			}
		}

		// Token: 0x0600017F RID: 383 RVA: 0x00002F11 File Offset: 0x00001111
		public override IChartPointView GetPointView(ChartPoint point, string label)
		{
			return this.method_3(point, label);
		}

		// Token: 0x06000180 RID: 384 RVA: 0x0000A7E0 File Offset: 0x000089E0
		private void method_2()
		{
			base.SetCurrentValue(Series.StrokeThicknessProperty, 0.0);
			base.SetCurrentValue(GRowSeries.MaxRowHeigthProperty, 35.0);
			base.SetCurrentValue(GRowSeries.RowPaddingProperty, 2.0);
			base.SetCurrentValue(GRowSeries.LabelPositionProperty, BarLabelPosition.Top);
			Func<ChartPoint, string> value = new Func<ChartPoint, string>(this.method_4);
			base.SetCurrentValue(Series.LabelPointProperty, value);
			base.DefaultFillOpacity = 1.0;
			
		}

		// Token: 0x06000181 RID: 385 RVA: 0x0000A880 File Offset: 0x00008A80
		private IChartPointView method_3(ChartPoint chartPoint_0, string string_0)
		{
			Class9 @class = (Class9)chartPoint_0.View;
			if (@class == null)
			{
				Class9 class2 = new Class9();
				class2.IsNew = true;
				class2.method_1(new Class3());
				class2.Data = new CoreRectangle();
				@class = class2;
			}
			else
			{
				@class.IsNew = false;
				chartPoint_0.SeriesView.Model.Chart.View.EnsureElementBelongsToCurrentDrawMargin(@class.DataLabel);
			}
			if (base.DataLabels && @class.DataLabel == null)
			{
				@class.DataLabel = (@class.DataLabel = base.UpdateLabelContent(new DataLabelViewModel
				{
					FormattedText = string_0,
					Point = chartPoint_0
				}, @class.DataLabel));
			}
			if (!base.DataLabels && @class.DataLabel != null)
			{
				base.Model.Chart.View.RemoveFromDrawMargin(@class.DataLabel);
				@class.DataLabel = null;
			}
			@class.method_3(this.LabelsPosition);
			return @class;
		}

		// Token: 0x06000183 RID: 387 RVA: 0x00002D24 File Offset: 0x00000F24
		[CompilerGenerated]
		private string method_4(ChartPoint chartPoint_0)
		{
			return base.Model.CurrentYAxis.GetFormatter()(chartPoint_0.Y);
		}

		// Token: 0x04000114 RID: 276
		public static readonly DependencyProperty MaxRowHeigthProperty = DependencyProperty.Register("MaxRowHeigth", typeof(double), typeof(GRowSeries), new PropertyMetadata(0.0));

		// Token: 0x04000115 RID: 277
		public static readonly DependencyProperty RowPaddingProperty = DependencyProperty.Register("RowPadding", typeof(double), typeof(GRowSeries), new PropertyMetadata(0.0));

		// Token: 0x04000116 RID: 278
		public static readonly DependencyProperty LabelPositionProperty = DependencyProperty.Register("LabelPosition", typeof(BarLabelPosition), typeof(GRowSeries), new PropertyMetadata(BarLabelPosition.Top, Series.CallChartUpdater(false)));

		// Token: 0x04000117 RID: 279
		public static readonly DependencyProperty SharesPositionProperty = DependencyProperty.Register("SharesPosition", typeof(bool), typeof(GRowSeries), new PropertyMetadata(true));
	}
}
